<template>
  <div class="container flex-al">
    <div class="w100">
      <build-el-bread></build-el-bread>
    </div>
    <el-upload
     ref="upload"
      class="upload-demo"
      drag
      :headers="{
          Authorization:123456
      }"
      :data="{
          customizeId:1
      }"
      @on-success="success"
    :auto-upload="false"
      :action="action"
      multiple
    >
      <i class="el-icon-upload"></i>
      <div class="el-upload__text">将文件拖到此处，或<em>点击上传</em></div>
      <div class="el-upload__tip text-box " slot="tip">
        <p>请上传800M以下的文件，超过800M请发送邮件或发送快递</p>
        <p>投稿邮箱：2853295708@qq.com</p>
        <p>邮寄地址：北京市海淀区三里河路21号 甘家口大厦 910B室</p>
      </div>
    </el-upload>
    <el-button v-margin-top="'30px'" @click="submitUpload" type="primary">上传到服务器</el-button>
    <div  v-margin-top="'100px'"></div>
  </div>
</template>
<script>
import buildElBread from "@/components/build-el-bread";
import { MessageBox}from 'element-ui'
export default {
    data(){
        return {
            action:''
        }
    },
    created(){
        this.action=this.api.BASEURL+'/customize/uploadEntryFile'
    },
  components: {
    buildElBread,
  },
  methods:{
       submitUpload() {
        this.$refs.upload.submit();
      },
      success(){
          MessageBox({
            title: '成功！',
            message:'您的文件上传成功！',
            type: 'success'
        })
      }
  }
};
</script>
<style lang="less" scoped>
.text-box {
  p {
    font-size: 14px;
    line-height: 21px;
    &:nth-child(1) {
      font-size: 14px;
      color: #c81425;
    }
  }
}
</style>
